# str='hello world'
# for s in str:
#     print(s,end='-') #不换行，使用end='' 实现不换行

#1+2+3+...100=5050
# print(list(range(1,101)))
# print('*'*40)
sum=0
# for i in range(1,101):
#     sum+=i #sum=sum+i
# print(sum)

#print(list(range(1,1001,2)))
# for i in range(1,1001,2):
#     sum=sum+i
# print(sum)

# for i in range(1,1001):
#     if i%2!=0: #奇数
#         sum=sum+i
# print(sum)

# for i in range(1,1001):
#     sum = sum + i
#     if sum>10000:
#         print('退出....')
#         break #终止循环，退出整个循环
# print(sum)
# for i in range(1,1001):
#     sum = sum + i
#     if i==100:
#         print('退出....',i)
#         break #终止循环，退出整个循环
# print(sum)


# 2、实现简易的计算器（+，-，*，/ 亦可），并输出 - 与 * 的结果
# a=int(input('请输入一个数字:'))
# b=input('请在输入一个数字:')
# print(type(b))
# b=int(b)#str--->int
# print(type(b))
# opt=input('请输入操作到符 1 +，2 -，3 *，4 / :')
# if opt=='1':
#     print(a+b)
# elif opt=='2':
#    print(a- b)
# elif opt=='3':
#    print(a*b)
# elif opt=='4':
#    print(a/b)
# else:
#     print('操作错误')

# 3、求1+2!+3!+...+20!的和
sum=0
# for i in range(1,21):
#     sum=sum+i
# print(sum)
# print('-'*40)
# res=1
# for i in range(1,21):
#     res=res*i
#     sum=sum+res
#     if sum>1000000:
#         break   #break 退出整个循环，退出循环后不再执行
# print(f'i={i},sum={sum}')
    # if i % 5 == 0:
    #     print(sum)

# for i in range(1,101):
#     if i%2!=0: #奇数
#         continue  #停止当前循环，跳过本次循环进入下次循环，代码不在向下执行
#     print(i)

    # break 退出整个循环，退出循环后不再执行
    #continue 退出本次循环，继续下次循环
# while True:
#     print('死循环1')
# while 1:
#     print('死循环2')
# while 5>3:
#     print('死循环3')
# i=0
# while i<100:
#     i+=1
#     print(i,end='    ')#end='' 不换行
#     if i%10==0:
#         print() #换行

# for i in range(1,101):
#     if i%2!=0: #奇数
#         continue  #停止当前循环，跳过本次循环进入下次循环，代码不在向下执行
#     print(i)

# i=0
# c=0 #偶数出现的次数
# while i<100:
#     i+=1
#     if i%2!=0: #奇数
#         continue  #跳过本次循环进入下次循环
#     print(i,end='    ')#end='' 不换行
#     c=c+1 #记录偶数的次数
#     if c%5==0:
#         print() #换行


s='hello world'
c=0
# for i in s:
#     print(i)

# while c<len(s):
#    print(s[c])
#    c += 1

for i in range(1,10): #行数
    for j in range(1,i+1): #列
        print(f'{j}×{i}={j*i}',end='   ')
    print()#换行